{extend name="public/base"}
{block name="main"}
<div class="container" id="main">
    <form class="bs-example bs-example-form " action="./save" method="post">
        <fieldset>
            <legend>分类添加/修改</legend>
            <div class="control-group">
                <label class="control-label" for="select01">父分类</label>
                <div class="controls">
                    <select id="select01" name="pid" :value="pid">
                        <option value="0">顶级分类</option>
                        {volist name='category' id='vo'}
                        <option value="{$vo.id}">{:str_repeat('--',$vo.Count-1)}{$vo.c_name}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="author">分类名称</label>
                <div class="controls">
                    <input type="text" class="input-xlarge" id="c_name" name="c_name" :value="c_name" >
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" for="author">是否可用</label>
                <div class="controls">
                    <input type="checkbox" class="input-xlarge" id="enabled" name="enabled" value="1" v-model="enabled" >
                </div>
            </div>
            <div class="form-actions">
                <button type="submit" class="btn btn-primary">保存修改</button>
                <button type="reset" class="btn">取消</button>
                <input type="hidden" name="id" :value="id" >
            </div>
        </fieldset>
    </form>
</div>

<script>
  data ={$content|raw};
  new Vue({
      el:'#main',
      data:data
  })

</script>

{/block}